/* eslint-disable standard/object-curly-even-spacing */
/* eslint-disable standard/object-curly-even-spacing */
<template>
    <el-row class="tac">
      <el-col :span="24">
        <el-menu
          default-active="1"
          class="el-menu-vertical-demo"
         @select="handleSelect"
        >
          <el-menu-item index="1">
            <i class="el-icon-menu"></i>
            <span slot="title">详情信息</span>
          </el-menu-item>
          <el-menu-item index="2">
            <i class="el-icon-circle-plus-outline"></i>
             <span slot="title">新增列表</span>
          </el-menu-item>
        </el-menu>
      </el-col>
    </el-row>
</template>
<script>
export default {
  name: 'Aside',
  props: ['username'],
  data () {
    return {
      usernames: ''
    }
  },
  created: function () {
    console.log(this._props.username)
    this.usernames = this._props.username
  },
  methods: {
    handleSelect (key, keyPath) {
      console.log(key, keyPath)
      // eslint-disable-next-line eqeqeq
      if (key == 1) {
        this.$router.push({ path: '/list', query: {username: this.usernames} })
      // eslint-disable-next-line eqeqeq
      } else if (key == 2) {
        this.$router.push({ path: '/add', query: {username: this.usernames} })
      }
    }
  }
}
</script>
<style  lang="less" >
.el-menu-item{
  a{
    text-decoration: none;
  }
}
</style>
